/**
 * @author        hejiyang <silentmanager@163.com>
 * @date          2024-11-18 19:05:16
 * Copyright © YourCompanyName All rights reserved
 */
import request from '@/config/axios'
// 批量发货
export const batchDeliveringLogistics = async (data: {
  orderIds: number[]
  logisticType: number //物流类型（1.特惠包裹2.电商标快）
}) => {
  return await request.request({
    url: `/bms/logistics/batch-delivering`,
    method: 'POST',
    data
  })
}
// 合并发货
export const mergeDeliveringLogistics = async (data: {
  orderIds: number[]
  logisticType: number //物流类型（1.特惠包裹2.电商标快）
}) => {
  return await request.request({
    url: `/bms/logistics/merge-delivering`,
    method: 'POST',
    data
  })
}

// 更新订单【物流状态】
export const updateLogistics = async (
  data: {
    orderId: number //订单id
    logisticStatus: number //物流状态
  }[]
) => {
  return await request.request({
    url: `/bms/logistics/update`,
    method: 'POST',
    data
  })
}

// 查询【物流中心】订单
export const pageLogistics = async (params: {
  logisticStatus?: number //物流状态 1、待发货 2、快递中 3、拒签件 4、已签收 5、已回款  6、已退件   7、已取消 8、已退款
  pageNo: number //页码，从 1 开始
  pageSize: number //每页条数，最大值为 100
  auditTime: string[]
  createTime: string[]
}) => {
  return await request.get({
    url: `/bms/logistics/page`,
    params
  })
}

// 查询【物流中心】订单详情
export const getLogistics = async (orderId: number) => {
  return await request.get({
    url: `/bms/logistics/get/${orderId}`
  })
}

// 【物流中心】驳回订单、取消订单
export const rejectLogistics = async (orderIds: string[]) => {
  return await request.request({
    url: `/bms/logistics/reject/${orderIds}`,
    method: 'POST'
  })
}
